package com.example.mobile2021606140lhq0405;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity02 extends AppCompatActivity {

    private TextView textView2;
    private EditText edtTxtMain011;
    private EditText edtTxtMain012;
    private EditText edtTxtMain013;
    private EditText edtTxtMain014;
    private EditText edtTxtMain015;
    private EditText edtTxtMain016;
    private Button btnMain011;
    private EditText edtTxtMain0001;

    int a,b,c;
    String d;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main02);
        initView();

        btnMain011.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                a=Integer.parseInt(edtTxtMain014.getText().toString());
                b=Integer.parseInt(edtTxtMain015.getText().toString());
                c=Integer.parseInt(edtTxtMain016.getText().toString());

                int max=a;
                if (max<b){
                    max=b;
                }
                if (max<c){
                    max=c;
                }
                d=String.valueOf(max);
                edtTxtMain0001.setText(d);
            }
        });
    }

    private void initView() {
        textView2 = findViewById(R.id.textView2);
        edtTxtMain011 = findViewById(R.id.edtTxt_main_011);
        edtTxtMain012 = findViewById(R.id.edtTxt_main_012);
        edtTxtMain013 = findViewById(R.id.edtTxt_main_013);
        edtTxtMain014 = findViewById(R.id.edtTxt_main_014);
        edtTxtMain015 = findViewById(R.id.edtTxt_main_015);
        edtTxtMain016 = findViewById(R.id.edtTxt_main_016);
        btnMain011 = findViewById(R.id.btn_main_011);
        edtTxtMain0001 = findViewById(R.id.edtTxt_main_0001);
    }
}